<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center examine_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub examine_fd0_0'>
          <view class='flex flex-wrap align-center examine_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  examine_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='examine_fd0_0_c1_c0'>完善信息</text>
          </view>
          <view class='flex flex-wrap align-center justify-end examine_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---个人信息flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout examine_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch examine_fd1_0' v-if="status!='-1'">
          <view class='flex flex-wrap align-center'>
            <image class='examine_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"132.png"' v-if=" status=='1'"></image>
            <image class='examine_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"133.png"' v-if=" status=='3'"></image>
            <image class='examine_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"134.png"' v-if=" status=='2'"></image>
            <text class='examine_fd1_0_c0_c1' v-if="status=='1'">审核中</text><text class='examine_fd1_0_c0_c1_1'
              v-if=" status=='3'">审核不通过</text><text class='examine_fd1_0_c0_c1_2' v-if=" status=='2'">已通过</text>
            <text class='examine_fd1_0_c0_c2' v-if=" status=='1'">请耐心等待…</text>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch examine_fd1_0_c1' v-if=" status=='3'">
            <text class='examine_fd1_0_c1_c0'>不通过原因：{{reason}}</text>
            <!-- <button class='examine_fd1_0_c1_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/realname/realname`">重新提交</button> -->
          </view>
        </view>
        <view class='flex align-center justify-between examine_fd1_1'>
          <text class='examine_fd1_1_c0'>公司名称</text>
          <input type="text" placeholder="请输入公司名称" maxlength="15" class="inpu-box" v-model="company_name" />
        </view>
        <view class='flex align-center justify-between examine_fd1_2' @click.stop="pickerDiy1719971171261=true">
          <text class='examine_fd1_1_c0'>所在省市区</text>
          <text class='examine_fd1_1_c0'>{{addressSelect || '请选择'}}</text>
        </view>
        <view class='flex align-center justify-between examine_fd1_1'>
          <text class='examine_fd1_1_c0'>详细地址</text>
          <input type="text" placeholder="请输入详细地址" maxlength="25" class="inpu-box" v-model="detailed_address" />
        </view>
        <view class='flex align-stretch justify-between examine_fd1_4'>
          <text class='examine_fd1_4_c0'>营业执照</text>
          <!-- <view class='flex flex-wrap align-center justify-between'>
            <view class='flex flex-direction flex-wrap align-center'>
              <image class='examine_fd1_4_c1_c0_c0' mode="aspectFill" :src="business_license || STATIC_URL+'181.png'"
                @tap.stop="singleImagePreview(business_license)"></image>
            </view>
          </view> -->
          <view class='flex flex-direction flex-wrap align-center'>
            <benben-image-upload :path.sync="business_license" :img-id.sync="business_license" :is-cropping="false"
              :is-show-clean="true" class="upload position-relative">
              <!-- <text v-if="business_license != ''" data-type="clean"
                @click.stop="business_license = '';business_license=''"
                class='fu-iconfont2 position-absolute'>&#xE8E7;</text> -->
              <image class=' position-absolute del-icon' v-if="business_license != ''"
                @click.stop="business_license = '';business_license=''" mode="aspectFit" :src='STATIC_URL+"133.png"'>
              </image>
              <image class=" examine_fd1_4_c1_c0_c0" mode="aspectFill"
                :src="business_license ? business_license : STATIC_URL+'181.png'"></image>
            </benben-image-upload>
          </view>

        </view>
        <!-- <view class='flex align-stretch justify-between examine_fd1_4'>
          <text class='examine_fd1_4_c0'>营业执照</text>
          <view class='flex align-center justify-between examine_fd1_4_c2'>
            <view class='flex flex-direction flex-wrap align-center'>
              <image class='examine_fd1_4_c1_c0_c0' mode="aspectFill" :src='datatInfo.idcard_emblem'
                @tap.stop="singleImagePreview(datatInfo.idcard_emblem)"></image>

            </view>

          </view>
        </view> -->
        <view class='flex flex-direction justify-between examine_fd1_1'>
          <view class='examine_fd1_4_c0'>公司简介</view>
          <view class='flex flex-wrap publishresume_fd7_3_c1'>
            <benben-textarea class='flex publishresume_input_fd7_3_c1' :placeholder="'公司简介'" :adjust-position='true'
              :maxlength="100" :show-num='true' placeholder-style="color:#999;font-size:28rpx"
              v-model="company_introduction" />
            <template>
              <view class='flex flex justify-end publishresume_numberfd7_3_c1_c0'>
                <text>{{company_introduction.length}}</text>
                <text>/</text>
                <text>100</text>
              </view>
            </template>
          </view>
        </view>
      </view>
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex Publishlistings_flex_8"
        :style="{height:(120+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }" @click.stop="submit">
        <button class='Publishlistings_fd8_0'>保存</button>

      </view>

      <!---个人信息flex布局结束-->
      <!--地址选择开始 -->
      <benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1719971171261"
        :label.sync='addressSelect' :province.sync='address_province' :city.sync='address_city'
        :area.sync='address_district' mode='region' :mask-show='true' :picker-height='88' :hide-area='false'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between Publishlistings_picker2_0'>
            <text @tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
            <text>选择地址</text>
            <text class='Publishlistings_picker2_0_c2'
              @tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
      <!--地址选择结束 -->
    </view>
  </page-body>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        pickerDiy1719971171261: false,
        company_name: '',
        address_province: '',
        address_city: '',
        address_district: '',
        company_introduction: '',
        business_license: '',
        detailed_address: '',
        addressSelect: '',
        status: '',
        reason: '',
        certified: 0
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        certified
      } = options
      if (certified !== undefined) this.certified = certified
      if (certified !== undefined) this.status = certified
      if (this.certified != -1) {
        this.getResultsFunc()
      }

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {

      submit() {
        if (!this.company_name) {
          this.$message.info('请输入公司名称')
          return
        }
        if (!this.address_province) {
          this.$message.info('请选择地址')
          return
        }
        if (!this.detailed_address) {
          this.$message.info('请输入详细地址')
          return
        }
        if (!this.business_license) {
          this.$message.info('请上传营业执照')
          return
        }
        if (!this.company_introduction) {
          this.$message.info('请输入公司简介')
          return
        }
        this.$api.post(global.apiUrls.post637c7d436e440, {
          company_name: this.company_name,
          address_province: this.address_province,
          address_city: this.address_city,
          address_district: this.address_district,
          company_introduction: this.company_introduction,
          business_license: this.business_license,
          detailed_address: this.detailed_address
        }).then(res => {
          if (res.data.code == 1) {
            this.$message.info(res.data.msg)
            setTimeout(resule => {
              uni.navigateBack()
            }, 300)
          }
        })
      },
      //审核结果
      async getResultsFunc() {
        //请求方法
        //数据验证

        let datadatatInfo = await this.$api.get(global.apiUrls.post637c7e1d7d61e, {

        });

        if (datadatatInfo.data.code != 1) {
          this.$message.info(datadatatInfo.data.msg);
          return
        }
        let infodatatInfo = datadatatInfo.data;
        this.company_name = infodatatInfo.data.company_name
        this.address_province = infodatatInfo.data.address_province
        this.address_district = infodatatInfo.data.address_district
        this.company_introduction = infodatatInfo.data.company_introduction
        this.business_license = infodatatInfo.data.business_license
        this.detailed_address = infodatatInfo.data.detailed_address
        this.addressSelect = infodatatInfo.data.address_area
        this.status = infodatatInfo.data.status
        this.reason = infodatatInfo.data.reason
      }
    }
  };
</script>
<style lang="scss" scoped>
  .del-icon {
    width: 32rpx;
    height: 32rpx;
    top: 0;
    right: 0;
    z-index: 9;
  }

  .Publishlistings_fd8_0 {
    background: #FF6F02;
    border-radius: 44rpx;
    width: 690rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
  }

  .Publishlistings_flex_8 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 120rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
    left: 0rpx;
  }

  .Publishlistings_picker2_0_c2 {
    color: rgba(255, 111, 2, 1);
  }

  .Publishlistings_picker2_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .publishresume_fd7_3_c1 {
    background: rgba(248, 248, 250, 1);
    width: 686rpx;
    border-radius: 10rpx;
    padding: 24rpx;
    // margin: 0rpx auto 0rpx auto;
  }

  .publishresume_numberfd7_3_c1_c0 {
    width: 100%;
    font-size: 24rpx;
    color: var(--benbenFontColor0);
    line-height: 46rpx;
    font-weight: 400;
  }

  .publishresume_input_fd7_3_c1 {
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .examine_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .examine_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333333;
  }

  .examine_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .examine_fd0_0_c0 {
    width: 120rpx;
  }

  .examine_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .examine_flex_1 {
    background: #fff;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    background-size: 100% auto !important;
    position: relative;
  }

  .examine_fd1_4_c2 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .examine_fd1_4_c1_c0_c1 {
    color: var(--benbenFontColor0);
    font-size: 28rpx;
    font-weight: 400;
  }

  .examine_fd1_4_c1_c0_c0 {
    width: 314rpx;
    height: 204rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .examine_fd1_4_c0 {
    color: var(--benbenFontColor0);
    font-size: 32rpx;
    font-weight: 400;
    line-height: 40rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .examine_fd1_4 {
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    padding: 32rpx 0rpx 32rpx 0rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .examine_fd1_2 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 30rpx 0rpx 30rpx 0rpx;
    background-size: 100% auto !important;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .examine_fd1_1_c0 {
    color: var(--benbenFontColor0);
    font-size: 32rpx;
    font-weight: 400;
    line-height: 40rpx;
  }

  .examine_fd1_1 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 32rpx 0rpx 32rpx 0rpx;
    background-size: 100% auto !important;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .inpu-box {
    text-align: right;
  }

  .examine_fd1_0_c1_c1 {
    background: var(--benbenbgColor2);
    border-radius: 100rpx 100rpx 100rpx 100rpx;
    width: 320rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    height: 88rpx;
    margin: 0rpx 0rpx 0rpx 133rpx;
  }

  .examine_fd1_0_c1_c0 {
    margin: 0rpx 0rpx 27rpx 48rpx;
    color: var(--benbenFontColor1);
    font-size: 28rpx;
    font-weight: 400;
  }

  .examine_fd1_0_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .examine_fd1_0_c0_c2 {
    color: var(--benbenFontColor4);
    font-size: 28rpx;
    font-weight: 400;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .examine_fd1_0_c0_c1_2 {
    color: var(--benbenFontColor7);
    font-size: 32rpx;
    font-weight: 400;
  }

  .examine_fd1_0_c0_c1_1 {
    color: var(--benbenFontColor5);
    font-size: 32rpx;
    font-weight: 400;
  }

  .examine_fd1_0_c0_c1 {
    color: var(--benbenFontColor4);
    font-size: 32rpx;
    font-weight: 400;
  }

  .examine_fd1_0_c0_c0 {
    width: 33rpx;
    height: 33rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .examine_fd1_0 {
    background: #D4E6FF;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    padding: 30rpx 32rpx 30rpx 32rpx;
  }
</style>
